#include <stdio.h>
#include <stdlib.h>

	int main(int argc,char **argv)
{
	FILE *fps,*fpd;
	int ch;

	if(argc != 3)
	{
		fprintf(stderr,"Unge:%s <filename> <filename>\n",argv[0]);
		exit(1);
	}

	fps = fopen(argv[1],"a+");
	if(fps == NULL)
	{
		perror("fopen1():");
		exit(1);
	}
	fpd = fopen(argv[2],"a+");
	if(fpd == NULL)
	{
		perror("fopen2():");
		exit(1);
	}

	while(1)
	{
		ch = fgetc(fps);
		if(ch == EOF)
			break;
		fputc(ch,fpd);
	}


//优先关闭需要依赖文件，再关闭被依赖文件
	fclose(fpd);	
	fclose(fps);

	exit(0);
}
